import 'package:backend.core/core/domain/entities/api/app_store/api_app_store_transaction_offer_type.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_transaction_offer_type.dart';

abstract class CreateApiAppStoreTransactionOfferTypeFromInternalOne {
  ApiAppStoreTransactionOfferType call({
    required AppStoreTransactionOfferType offerType,
  });
}

class CreateApiAppStoreTransactionOfferTypeFromInternalOneImpl
    implements CreateApiAppStoreTransactionOfferTypeFromInternalOne {
  const CreateApiAppStoreTransactionOfferTypeFromInternalOneImpl();

  @override
  ApiAppStoreTransactionOfferType call({
    required AppStoreTransactionOfferType offerType,
  }) {
    switch (offerType) {
      case AppStoreTransactionOfferType.regular:
        return ApiAppStoreTransactionOfferType.regular;
      case AppStoreTransactionOfferType.introductory:
        return ApiAppStoreTransactionOfferType.introductory;
      case AppStoreTransactionOfferType.promotional:
        return ApiAppStoreTransactionOfferType.promotional;
      case AppStoreTransactionOfferType.subscriptionCode:
        return ApiAppStoreTransactionOfferType.subscriptionCode;
    }
  }
}
